﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


// 消息的类型  

public class NotifyEvent
{
    protected Dictionary<string, object> arguments;  //参数  
    protected string type;  //事件类型  
    protected System.Object sender;    //发送者  

    // bean函数  
    public string Type
    {
        get { return type; }
        set { type = value; }
    }

    public Dictionary<string, object> Params
    {
        get { return arguments; }
        set { arguments = value; }
    }

    public System.Object Sender
    {
        get { return sender; }
        set { sender = value; }
    }

    // 常用函数  
    public override string ToString()
    {
        return type + " [ " + ((sender == null) ? "null" : sender.ToString()) + " ] ";
    }

    public NotifyEvent Clone()
    {
        return new NotifyEvent(type, arguments, sender);
    }

    // 构造函数  
    public NotifyEvent(string type, System.Object sender)
    {
        Type = type;
        Sender = sender;
        if (arguments == null)
        {
            arguments = new Dictionary<string, object>();
        }
    }

    public NotifyEvent(string type, Dictionary<string, object> args, System.Object sender)
    {
        Type = type;
        arguments = args;
        Sender = sender;
        if (arguments == null)
        {
            arguments = new Dictionary<string, object>();
        }
    }


}
